package com.qf.mapper;

/*
 *  @author Administrator
 *  @version V1.0
 *  @Project smartdeviceplatgorm
 *  @Package com.qf.mapper
 *  @Description
 *  @Date2022/3/14 0014 16:43
 */

import com.qf.bean.SysUserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface SysUserInfoMapper {

    @Select("select * from sys_user_info where u_id=#{userId}")
    SysUserInfo findById(Integer userId);

    @Select("select * from sys_user_info")
    List<SysUserInfo> findAllSysUserInfo();

    void addSysUserInfo(SysUserInfo sysUserInfo);

    @Select("select * from sys_user_info where username=#{username}")
    SysUserInfo findByUsername(String username);


    SysUserInfo findByEmail(@Param("email") String email,@Param("userId") Integer userId);


    SysUserInfo findByPhone(@Param("phone") String phone,@Param("userId") Integer userId);

    @Select("select * from sys_user_info where username=#{username};")
    SysUserInfo findByUsernameAndPassword(@Param("username") String userName);

    void stopLog(Integer id);

    void updateLastTime(Integer id, Date date);

    void updateCurrentTime(Integer id,Date date);

    void updateSysUserInfo(SysUserInfo sysUserInfo);

    @Update("update sys_user_info set password=#{password} where u_id=#{uId}")
    void updatePassword(String password);
}
